{include file="public_iframe:head"}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>顾问列表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-3">
                            <a href="{:url('Adviser/add')}" class="btn btn-primary">添加</a>
                        </div>
                        <div class="col-sm-3">
                        </div>
                        <form class="form-inline" action="" method="get">
                            <div class="col-sm-9">
                                <div class="input-group col-sm-3  pull-right">
                                    <input type="text" name="keyword" value="{$keyword?$keyword:'';}" placeholder="顾问" class="input-sm form-control">
			                                    <span class="input-group-btn">
			                                      <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
			                                    </span>
                                </div>
                            </div>
                        </form>
                    </div>

                    <br />

                    <div class="table-responsive">
                        <form action="__URL__/operate" method="post" id="operate_form">
                            <table class="table table-bordered table-hover"
                                   id="categoryTable">
                                <thead>
                                <tr class="active">
                                    <th><input onclick="choosebox(this)" type="checkbox" /></th>
                                    <th height="40">编号</th>
                                    <th height="40">排序号</th>
                                    <th>顾问名</th>
                                    <th>头像</th>
                                    <th>业务范围</th>
                                    <th>业务介绍</th>
                                    <th>顾问级别</th>
                                    <th>完成单子</th>
                                    <th>证(是否)</th>
                                    <th>诺(是否)</th>
                                    <th>性别</th>
                                    <th>状态</th>
                                    <th>注册时间</th>
                                    <th width="80">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {volist name="adviser" id="users"}
                                    <tr>
                                        <td><input type="checkbox" name="users_id[]" value="{$users['id']}" /></td>
                                        <td>{$users['id']}</td>
                                        <td>{$users['sort']}</td>
                                        <td>{if condition="$users['advisername']"}{$users['advisername']}{else/}暂无{/if}</td>
                                        <td><img alt="image" style="width:50px;height:50px;" class="img-circle" src="__STATIC__/uploads/{$users.head_img}"></td>
                                        <td>{$users['item']}</td>
                                        <td>{$users['introduction']}</td>
                                        <td>{$users['level']}</td>
                                        <td>{$users['sore']}笔</td>
                                        <td>{if condition="$users['is_zheng']=='1'"}证{else/}无证{/if}</td>
                                        <td>{if condition="$users['is_nuo']=='1'"}诺{else/}无诺{/if}</td>
                                        <td>{if condition="$users['sex']=='1'"}男{else/}女{/if}</td>
                                        <td>{if condition="$users['status']=='1'"}启用{else/}禁用{/if}</td>
                                        <td>{$users['creatime']|date="Y-m-d",###}</td>
                                        <td class="center" width="70">
                                            <a href="{:url('Adviser/edit',array('id'=>$users['id']))}" class="btn btn-primary">编辑</a>
                                            <a  href="javascript:;" data-id="{$users.id}"  class="btn btn-danger" >删除</a>
                                        </td>
                                    </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </form>
                        <div class="col-sm-12" style="padding:0px;">
                            <ul class="pagination  pull-right">
                                {$page}
                            </ul>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script>
    //删除
    $(".btn-danger").click(function(){
        var id = $(this).attr('data-id');
        parent.layer.confirm('删除数据无法恢复，并且会影响用户数据，确定删除？', {
            shade:false,
            btn: ['确定', '取消']
        }, function() {
            $.post("{:url('Adviser/del')}", {id: id}, function (result) {
                if (result.code == '0') {
                    parent.layer.alert(result.msg);
                } else {
                    parent.layer.msg(result.msg, {
                                icon:1
                            },
                            function (index, item) {
//								parent.layer.close(index);
                                location.reload();
                            });
                }
            });
        });
    })
</script>
</body>

</html>